package com.yanqu.road.server.manager.activity.suitang.task.impl;

import com.yanqu.road.entity.activity.suitang.enums.eSuiTangStage;
import com.yanqu.road.entity.activity.suitang.enums.eSuiTangTaskType;
import com.yanqu.road.server.manager.activity.suitang.activity.CrossSuiTangActivity;
import com.yanqu.road.server.manager.activity.suitang.task.BaseCrossSuiTangTask;
import com.yanqu.road.utils.executor.GeneralTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CrossSuiTangNpcTask extends GeneralTask {

    private static final Logger log = LoggerFactory.getLogger(CrossSuiTangNpcTask.class);
    private CrossSuiTangActivity activity;

    private int total;

    private int taskIndex;

    public CrossSuiTangNpcTask(CrossSuiTangActivity activity, int total, int taskIndex) {
        this.activity = activity;
        this.total = total;
        this.taskIndex = taskIndex;
    }

    @Override
    public void doRun() {
        if (activity.getCrossSuiTangData().getStep().getValue() >= eSuiTangStage.Stage1EndTime.getValue() || !activity.getNpcTestActivityMgr().isNpcMode()) {
            return;
        }
        try {
            activity.getNpcTestActivityMgr().npcTask(total, taskIndex);
        } catch (Exception e) {
            log.error("CrossSuiTangNpcTask error");
        }

    }
}
